import config from '@/utils/config.js'
export default {
	
	data() {
		return {
			userInfo:'',
			// 默认的全局分享内容
			title: '邀请好友使用YOMeeDoll!',//分享时标题名字
			path:'/pages/mine/index', // 全局分享的路径，比如 首页
			imageUrl:'https://yomeedoll.qifudaren.net/static/upload/ca44c3de4c3f1856/9248ada602a392f3.jpg'
			
		}
	},
	
	onShow() {
		 if(uni.getStorageSync('userInfo')){      
		    let userInfo=uni.getStorageSync('userInfo')
			this.path='/pages/mine/index?recommendId='+userInfo.id
			this.imageUrl=config.api_url+'/static/upload/ca44c3de4c3f1856/9248ada602a392f3.jpg'
		}			
	},
	
	// 定义全局分享
	// 1.发送给朋友
	onShareAppMessage(res) {
		return {
			title: this.title,
			path: this.path,
			imageUrl: this.imageUrl,
		}
	},
	//2.分享到朋友圈
	onShareTimeline(res) {
		return {
			title: this.title,
			path: this.path,
			imageUrl: this.imageUrl,
		}
	},
}